﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using BrainTechLLC;
using System.Windows.Threading;
using System.Windows;
using BrainTechLLC.ThreadSafeObjects;
using System.Threading;
using System.Diagnostics;
using System.Reflection;

namespace BrainTechLLC
{
    public static class MathExt
    {
        public static bool Within(this double d1, double d2, double percent)
        {
            double d1Low = d1 - (d1 * percent);
            double d1High = d1 + (d1 * percent);
            return (d2 < d1High && d2 > d1Low);
        }
    }
}
